function loadMdTrueField(idCanvas) {

	var TF_Font1 = 'bold 24px "ＭＳ 明朝", "平成明朝", "Meiryo", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_Font2 = 'bold 12px "Meiryo", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_FontBtn = 'bold 28px  "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_Font3 = 'bold oblique 16px "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_Font4 = 'bold 48px  "ＭＳ 明朝", "平成明朝", "Meiryo", "MS PGothic", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_Font5 = 'bold 20px "Meiryo", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	var TF_FontBt = 'bold 30px "Meiryo", "ヒラギノ角ゴ Pro W3", "Osaka", "Verdana", "arial", "sans-serif"';
	StMasuIdObject = {
		'11' : 1,
		'12' : 2,
		'13' : 3,
		'14' : 4,
		'15' : 5,
		'21' : 6,
		'22' : 7,
		'23' : 8,
		'24' : 9,
		'25' : 10,
		'31' : 11,
		'32' : 12,
		'33' : 13,
		'34' : 14,
		'35' : 15,
		'41' : 16,
		'42' : 17,
		'43' : 18,
		'44' : 19,
		'45' : 20,
		'51' : 21,
		'52' : 22,
		'53' : 23,
		'54' : 24,
		'55' : 25
	};
	StMasuIdArray = [ '11', '12', '13', '14', '15', '21', '22', '23', '24', '25', '31', '32', '33', '34', '35', '41', '42', '43', '44', '45', '51', '52', '53', '54', '55' ];
	StMasuStArray = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];

	mvTxt = '';
	mvSw = 0;
	mvFrmPstn = '';
	mvFrmClr = '';
	mvPstn = '';

	ptTxt = '';
	ptSw = 0;
	ptPstn = '';
	ptFrmPstn = '';
	ptKmCnt = 0;

	plyrbrpnt = 0;
	enmybrpnt = 0;

	selKomaTxtArray = [ '', '', '', '', '', '' ];
	selKomaBpArray = [ '', '', '', '', '', '' ];
	selKomaApArray = [ '', '', '', '', '', '' ];
	selKomaTypeArray = [ '', '', '', '', '', '' ];
	selKomaPstnArray = [ '', '', '', '', '', '' ];

	enmyKomaTxtArray = [ '一', '二', '三', '四', '五', '六' ];
	enmyKomaBpArray = [ '9999', '9', '99', '999', '111', '11' ];
	enmyKomaApArray = [ '9', '99', '999', '9999', '1', '11' ];
	enmyKomaTypeArray = [ 'KI', 'HI', 'KIN', 'DO', 'SUI', 'KI' ];
	enmyKomaPstnArray = [ '11', '22', '33', '42', '51', '' ];

	selCount = 0;
	selPstn = '';
	selArray = [ 0, 0, 0, 0, 0, 0, 0, 0 ];
	hdArray = [ hdTxt01, hdTxt02, hdTxt03, hdTxt04, hdTxt05, hdTxt06, hdTxt07, hdTxt08 ];
	bpArray = [ kanji01Bp, kanji02Bp, kanji03Bp, kanji04Bp, kanji05Bp, kanji06Bp, kanji07Bp, kanji08Bp ];
	apArray = [ kanji01Ap, kanji02Ap, kanji03Ap, kanji04Ap, kanji05Ap, kanji06Ap, kanji07Ap, kanji08Ap ];
	typeArray = [ kanji01Type, kanji02Type, kanji03Type, kanji04Type, kanji05Type, kanji06Type, kanji07Type, kanji08Type ];

	// 敵選手名の描画
	jc.rect(0, 0, 115, 20, 'rgba(255,0,0,1.0)', 1);
	jc.text(enemyName, 60, 15, 'rgb(255,255,255)').font(TF_Font3).align('center').id('TF_EName');

	// 選手見出し枠の描画
	jc.rect(115, 0, 60, 20, 'rgba(255,255,255,1.0)', 1);
	jc.text('選手名', 145, 15, 'rgb(0,0,0)').font(TF_Font3).align('center');

	// 自選手名の描画
	jc.rect(175, 0, 115, 20, 'rgba(0,0,255,1.0)', 1).id('TF_bar02');
	jc.text(playerName, 230, 15, 'rgb(255,255,255)').font(TF_Font3).align('center').id('TF_PName');

	// 敵選手体力数値の描画
	jc.rect(0, 20, 115, 20, 'rgba(255,0,0,1.0)', 1).id('TF_bar03');
	jc.text(enmybrpnt, 60, 35, 'rgb(255,255,255)').font(TF_Font3).align('center').id('TF_EP');

	// 体力見出し枠の描画
	jc.rect(115, 20, 60, 20, 'rgba(255,255,255,1.0)', 1);
	jc.text('体力', 145, 35, 'rgb(0,0,0)').font(TF_Font3).align('center');

	// 自選手体力数値の描画
	jc.rect(175, 20, 115, 20, 'rgba(0,0,255,1.0)', 1);
	jc.text(plyrbrpnt, 230, 35, 'rgb(255,255,255)').font(TF_Font3).align('center').id('TF_PP');

	// 敵選手の描画
	var imgEneTF = new Image();
	imgEneTF.src = '/static/image/mdkbr/' + enemyCG;
	imgEneTF.onload = function() {
		jc.image(imgEneTF, 0, 40, 145, 280, 50, 0, 200, 400).visible(false).id('TF_Ene1D');
	}

	// 自選手の描画
	var imgPlyTF = new Image();
	imgPlyTF.src = '/static/image/mdkbr/' + playerCG;
	imgPlyTF.onload = function() {
		jc.image(imgPlyTF, 145, 40, 145, 280, 50, 0, 200, 400).visible(false).id('TF_Ply1D');
	}

	var mvPsbleArray = [];
	var i;
	var j;
	var k;
	var l;
	var X1;
	var X2;
	var X3;
	var Y1;
	var Y2;
	var H = 45;
	var W = 45;
	var idxPlyr = 0;
	var idxEnmy = 0;

	Y1 = 50;
	for (i = 1; i <= 5; i++) {
		X1 = 30;
		for (j = 1; j <= 5; j++) {
			jc.rect(X1, Y1, W, H, 'rgba(130,130,130,0.6)', 1).id('TF_Fld' + i + j).layer('TF_L_Fld' + i + j);

			jc.circle(X1 + 23, Y1 + 22, 18, 'rgba(255,255,100)', 1).shadow({
				x : 2,
				y : 2,
				color : '#000000'
			}).visible(false).id('TF_Crcl' + i + j).layer('TF_L_KJ' + i + j);

			jc.text('', X1 + 23, Y1 + 30, 'rgb(0,0,0)').font(TF_Font1).align('center').visible(false).id('TF_Txt' + i + j).layer('TF_L_KJ' + i + j);

			jc.rect(X1, Y1, W, H, 'rgba(0,0,0,0.6)', 1).click(function() {
				mvPstn = this.id().substring(9);
				if (ptSw == 1) {
					if (jc('#TF_Txt' + mvPstn).string() == '') {
						jc('#TF_Txt' + mvPstn).string(ptTxt);
						jc.layer('TF_L_KJ' + mvPstn).objects().visible(true);
						jc('#TF_Fld' + mvPstn).color(setMasuClr(mvPstn, 4));
						jc('#TF_KomaBH' + ptFrmPstn).opacity(0);
						setStMasuSt(mvPstn, 4);
						selKomaPstnArray[(parseInt(ptFrmPstn) - 1)] = mvPstn;
						plyrbrpnt = plyrbrpnt + parseInt(selKomaBpArray[(parseInt(ptFrmPstn) - 1)]);
						jc('#TF_PP').string(plyrbrpnt);
						ptFrmPstn = ''
						ptPstn = ''
						ptTxt = '';
						ptSw = 0;
						ptKmCnt++;
					}
				} else if (ptSw == 0) {
				} else if (jc('#TF_Txt' + mvPstn).string() != '' || mvSw == 1) {
					if (mvSw == 0) {
						if (!enmyChck(mvPstn)) {
							mvTxt = jc('#TF_Txt' + mvPstn).string();
							mvFrmClr = jc('#TF_Fld' + mvPstn).color();
							mvFrmPstn = mvPstn;
							jc('#TF_Fld' + mvPstn).color('rgba(0,255,0,0.6)');
							mvPsbleArray = mvPsbleChck(mvPstn);
							for (k = 0; k < 8; k++) {
								if (mvPsbleArray[k] != '') {
									jc('#TF_Fld' + mvPsbleArray[k]).color('rgba(0,200,0,0.6)');
								}
							}
							mvSw = 1;
						}
					} else {
						if (mvToChck(mvPstn)) {
							mvPsbleArray = mvPsbleChck(mvFrmPstn);
							for (k = 0; k < 8; k++) {
								if (mvPsbleArray[k] == mvPstn) {
									if (enmyChck(mvPstn)) {
										idxPlyr = getPstnToIndexPlyr(mvFrmPstn);
										idxEnmy = getPstnToIndexEnmy(mvPstn);
										jc('#TF_TxtEnmy').string(enmyKomaTxtArray[idxEnmy]);
										jc('#TF_TxtPlyr').string(selKomaTxtArray[idxPlyr]);
										jc('#TF_BpEnmy').string(enmyKomaBpArray[idxEnmy]);
										jc('#TF_BpPlyr').string(selKomaBpArray[idxPlyr]);
										jc.layer('TF_L_bttl').objects().visible(true);
										jc.layer('TF_L_bttl_E').objects().visible(true);
										jc.layer('TF_L_bttl_P').objects().visible(true);

										battleResult = '';
										attackStartTF(idCanvas, enmyKomaBpArray[idxEnmy], selKomaBpArray[idxPlyr], enmyKomaApArray[idxEnmy], selKomaApArray[idxPlyr], enmyKomaTypeArray[idxEnmy], selKomaTypeArray[idxPlyr]);

									} else {
										jc('#TF_Fld' + mvPsbleArray[k]).color(setMasuClr(mvPsbleArray[k], getStMasuSt(mvPsbleArray[k])));
										jc.layer('TF_L_KJ' + mvFrmPstn).objects().visible(false);
										jc('#TF_Txt' + mvFrmPstn).string('');
										jc('#TF_Txt' + mvPstn).string(mvTxt);
										jc('#TF_Fld' + mvFrmPstn).color(setMasuClr(mvFrmPstn, 2));
										jc.layer('TF_L_KJ' + mvPstn).objects().visible(true);
										mvPsbleArray = mvPsbleChck(mvFrmPstn);
										for (l = 0; l < 8; l++) {
											if (mvPsbleArray[l] != '') {
												jc('#TF_Fld' + mvPsbleArray[l]).color(setMasuClr(mvPsbleArray[l], getStMasuSt(mvPsbleArray[l])));
											}
										}
										setStMasuSt(mvFrmPstn, 2);
										setStMasuSt(mvPstn, 4);
										jc('#TF_Fld' + mvPstn).color(setMasuClr(mvPstn, 4));
										idxPlyr = getPstnToIndexPlyr(mvFrmPstn);
										selKomaPstnArray[idxPlyr] = mvPstn;

										mvSw = 0;
										break;
									}
								}
							}
						} else if (mvPstn == mvFrmPstn) {
							jc('#TF_Fld' + mvFrmPstn).color(setMasuClr(mvFrmPstn, 2));
							mvPsbleArray = mvPsbleChck(mvFrmPstn);
							for (k = 0; k < 8; k++) {
								if (mvPsbleArray[k] != '') {
									jc('#TF_Fld' + mvPsbleArray[k]).color(setMasuClr(mvPsbleArray[k], getStMasuSt(mvPsbleArray[k])));
								}
							}
							mvSw = 0;
						}
					}
				}
			}).opacity(0).visible(false).id('TF_HdnFld' + i + j).layer('TF_L_HdnFld' + i + j);

			X1 = X1 + H + 2;
		}
		Y1 = Y1 + W + 2;
	}

	X2 = 10;
	for (i = 1; i <= 6; i++) {
		jc.rect(X2, 300, 40, 70, 'rgba(255,255,255,1)', 1).id('TF_KomaB' + i).layer('TF_L_Koma' + i);
		jc.rect(X2 + 2, 302, 36, 66, setTypeClr(selKomaTypeArray[i - 1]), 1).id('TF_KomaT' + i).layer('TF_L_Koma' + i);
		jc.text(selKomaTxtArray[i - 1], X2 + 20, 325, 'rgb(255,255,255)').font(TF_Font1).align('center').id('TF_KomaTxt' + i).layer('TF_L_Koma' + i);
		jc.text(selKomaBpArray[i - 1], X2 + 20, 345, 'rgb(255,255,255)').font(TF_Font2).align('center').id('TF_KomaBp' + i).layer('TF_L_Koma' + i);
		jc.text(selKomaApArray[i - 1], X2 + 20, 360, 'rgb(255,255,255)').font(TF_Font2).align('center').id('TF_KomaAp' + i).layer('TF_L_Koma' + i);
		jc.rect(X2, 300, 40, 70, 'rgba(0,0,255,0.5)', 1).opacity(0).visible(false).click(function() {
			ptPstn = this.id().substring(9);
			if (ptSw == 0) {
				if (ptKmCnt > 4) {
					alert('すでに５つの漢字を配置済です\n「配置完了」ボタンを押して下さい');
				} else {
					if (selKomaPstnArray[(parseInt(ptPstn) - 1)] != '') {
						alert('この漢字は配置済です');
					} else {
						ptTxt = jc('#TF_KomaTxt' + ptPstn).string();
						ptFrmPstn = ptPstn;
						ptSw = 1;
						this.opacity(1);
					}
				}
			} else if (ptFrmPstn == ptPstn) {
				ptFrmPstn = ''
				ptPstn = ''
				ptTxt = '';
				ptSw = 0;
				this.opacity(0);
			}
		}).id('TF_KomaBH' + i).layer('TF_L_KomaH' + i);
		X2 = X2 + 45;
	}

	// 漢字フォルダの描画
	jc.rect(15, 50, 255, 240, 'rgba(255,255,255,1)', 1).layer('TF_L_SelKoma');

	jc.text('対戦に使う漢字を', 145, 80, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_SelKoma');
	jc.text('『６つ』選んで', 145, 100, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_SelKoma');
	jc.text('決定ボタンをクリック！', 145, 120, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_SelKoma');

	X3 = 25;
	Y2 = 130;

	for (i = 1; i <= 8; i++) {
		jc.rect(X3, Y2, 53, 48, 'rgba(0,0,0,1)', 0).id('TF_hd' + i).layer('TF_L_SelKoma').click(function() {
			selPstn = this.id().substring(5);
			if (jc('#TF_hdText' + selPstn).string() != '') {
				if (this.color() != '0,0,255,0.5') {
					if (selCount < 6) {
						this.color('rgba(0,0,255,0.5)').attr('fill', 1);
						selArray[(parseInt(selPstn) - 1)] = 1;
						selCount++;
					}
				} else {
					this.color('rgba(0,0,0,1)').attr('fill', 0);
					selArray[parseInt(selPstn) - 1] = 0;
					selCount--;
				}
			}
		});
		jc.text(hdArray[i - 1], X3 + 2, Y2 + 40, 'rgb(0,0,0)').id('TF_hdText' + i).font(TF_Font4).layer('TF_L_SelKoma');
		if (i == 4) {
			X3 = 25;
			Y2 = 187;
		} else {
			X3 = X3 + 60;
		}
	}

	// 選択決定ボタン
	jc.rect(85, 250, 120, 30, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('TF_B_Sel').mouseover(function() {
		jc('#TF_Sel').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_Sel').color('rgb(0,0,0)');
	}).click(function() {
		if (selCount < 6) {
			alert('漢字を６つ選んで下さい');
		} else {
			l = 0;
			for (i = 0; i < 8; i++) {
				if (selArray[i] == 1) {
					selKomaTxtArray[l] = hdArray[i];
					selKomaBpArray[l] = bpArray[i];
					selKomaApArray[l] = apArray[i];
					selKomaTypeArray[l] = typeArray[i];
					jc('#TF_KomaT' + (l + 1)).color(setTypeClr(selKomaTypeArray[l]), 1);
					jc('#TF_KomaTxt' + (l + 1)).string(selKomaTxtArray[l]);
					jc('#TF_KomaBp' + (l + 1)).string(selKomaBpArray[l]);
					jc('#TF_KomaAp' + (l + 1)).string(selKomaApArray[l]);
					l++;
				}
			}
			jc.layer('TF_L_SelKoma').objects().visible(false);
			jc.layer('TF_L_4').objects().visible(false);
			jc.layer('TF_L_PutKoma').objects().visible(true);
			jc.layer('TF_L_Put').objects().visible(true);
			for (i = 1; i <= 5; i++) {
				for (j = 4; j <= 5; j++) {
					jc.layer('TF_L_HdnFld' + i + j).objects().visible(true);
				}
			}
			for (i = 1; i <= 6; i++) {
				jc.layer('TF_L_KomaH' + i).objects().visible(true);
			}
		}
	}).layer('TF_L_4');

	// 選択決定
	jc.text('決　定', 145, 275, 'rgb(0,0,0)').font(TF_FontBtn).align('center').mouseover(function() {
		jc('#TF_Sel').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_Sel').color('rgb(0,0,0)');
	}).id('TF_Sel').layer('TF_L_4');

	// 漢字フォルダの描画
	jc.rect(0, 50, 170, 233, 'rgba(255,255,255,1)', 1).layer('TF_L_PutKoma');
	jc.text('下の６つの中から', 85, 80, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('出場させる漢字を', 85, 100, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('１つずつ選択して', 85, 120, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('右のマスに配置', 85, 140, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('して下さい', 85, 160, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('一度に出場できる', 85, 200, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');
	jc.text('漢字は５つだよ', 85, 220, 'rgb(0,0,0)').font(TF_Font5).align('center').layer('TF_L_PutKoma');

	// 配置決定ボタン
	jc.rect(20, 235, 125, 30, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('TF_B_Put').mouseover(function() {
		jc('#TF_Put').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_Put').color('rgb(0,0,0)');
	}).click(function() {
		if (ptKmCnt < 4) {
			alert('まだ５つの漢字を配置してないよ');
		} else {
			jc.layer('TF_L_PutKoma').objects().visible(false);
			jc.layer('TF_L_Put').objects().visible(false);
			jc('#TF_Ene1D').visible(true);
			jc('#TF_Ply1D').visible(true);
			for (i = 1; i <= 5; i++) {
				for (j = 1; j <= 3; j++) {
					jc.layer('TF_L_HdnFld' + i + j).objects().visible(true);
				}
			}
			ptSw = 9;
		}
	}).layer('TF_L_Put');

	// 配置決定
	jc.text('配置完了', 85, 260, 'rgb(0,0,0)').font(TF_FontBtn).align('center').mouseover(function() {
		jc('#TF_Put').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_Put').color('rgb(0,0,0)');
	}).id('TF_Put').layer('TF_L_Put');

	jc.layer('TF_L_PutKoma').objects().visible(false);
	jc.layer('TF_L_Put').objects().visible(false);

	// 漢字フォルダの描画
	jc.rect(30, 97, 233, 139, 'rgba(10,100,10,1)', 1).layer('TF_L_bttl');

	jc.circle(90, 155, 40, 'rgba(255,255,100)', 1).shadow({
		x : 2,
		y : 2,
		color : '#000000'
	}).id('TF_CrclEnmy').layer('TF_L_bttl_E');

	jc.text('', 90, 170, 'rgb(0,0,0)').font(TF_Font4).align('center').id('TF_TxtEnmy').layer('TF_L_bttl_E');

	jc.circle(200, 155, 40, 'rgba(255,255,100)', 1).shadow({
		x : 2,
		y : 2,
		color : '#000000'
	}).id('TF_CrclPlyr').layer('TF_L_bttl_P');

	jc.text('', 200, 170, 'rgb(0,0,0)').font(TF_Font4).align('center').id('TF_TxtPlyr').layer('TF_L_bttl_P');

	jc.text('', 90, 220, 'rgb(255,255,255)').font(TF_Font5).align('center').id('TF_BpEnmy').layer('TF_L_bttl');
	jc.text('', 200, 220, 'rgb(255,255,255)').font(TF_Font5).align('center').id('TF_BpPlyr').layer('TF_L_bttl');

	jc.line([ [ 145, 130 ], [ 150, 141 ], [ 162, 136 ], [ 155, 147 ], [ 168, 152 ], [ 155, 157 ], [ 162, 168 ], [ 150, 162 ], [ 145, 175 ], [ 140, 162 ], [ 128, 168 ], [ 135, 157 ], [ 122, 152 ], [ 135, 147 ], [ 128, 136 ], [ 140, 141 ] ], 'rgba(255,255,0,0.8)', 1).visible(false).id('TF_BEfect01').layer('TF_L_bttl_EFCT');
	jc.line([ [ 145, 130 ], [ 150, 141 ], [ 162, 136 ], [ 155, 147 ], [ 168, 152 ], [ 155, 157 ], [ 162, 168 ], [ 150, 162 ], [ 145, 175 ], [ 140, 162 ], [ 128, 168 ], [ 135, 157 ], [ 122, 152 ], [ 135, 147 ], [ 128, 136 ], [ 140, 141 ] ], 'rgba(255,205,0,0.8)', 1).visible(false).id('TF_BEfect02').layer('TF_L_bttl_EFCT');
	jc.line([ [ 145, 130 ], [ 150, 141 ], [ 162, 136 ], [ 155, 147 ], [ 168, 152 ], [ 155, 157 ], [ 162, 168 ], [ 150, 162 ], [ 145, 175 ], [ 140, 162 ], [ 128, 168 ], [ 135, 157 ], [ 122, 152 ], [ 135, 147 ], [ 128, 136 ], [ 140, 141 ] ], 'rgba(255,135,0,0.8)', 1).visible(false).id("TF_BEfect03").layer('TF_L_bttl_EFCT');
	jc.line([ [ 145, 130 ], [ 150, 141 ], [ 162, 136 ], [ 155, 147 ], [ 168, 152 ], [ 155, 157 ], [ 162, 168 ], [ 150, 162 ], [ 145, 175 ], [ 140, 162 ], [ 128, 168 ], [ 135, 157 ], [ 122, 152 ], [ 135, 147 ], [ 128, 136 ], [ 140, 141 ] ], 'rgba(255,255,0,0.8)', 1).visible(false).id('TF_BEfect04').layer('TF_L_bttl_EFCT');
	jc.line([ [ 145, 130 ], [ 150, 141 ], [ 162, 136 ], [ 155, 147 ], [ 168, 152 ], [ 155, 157 ], [ 162, 168 ], [ 150, 162 ], [ 145, 175 ], [ 140, 162 ], [ 128, 168 ], [ 135, 157 ], [ 122, 152 ], [ 135, 147 ], [ 128, 136 ], [ 140, 141 ] ], 'rgba(255,205,0,0.8)', 1).visible(false).id('TF_BEfect05').layer('TF_L_bttl_EFCT');

	jc('#TF_BEfect01').transform(2, 0, 0, 2, -145, -145);
	jc('#TF_BEfect02').transform(2, 0, 0, 2, -145, -145);
	jc('#TF_BEfect03').transform(2, 0, 0, 2, -145, -145);
	jc('#TF_BEfect04').transform(2, 0, 0, 2, -145, -145);
	jc('#TF_BEfect05').transform(2, 0, 0, 2, -145, -145);

	jc.layer('TF_L_bttl').objects().visible(false);
	jc.layer('TF_L_bttl_E').objects().visible(false);
	jc.layer('TF_L_bttl_P').objects().visible(false);

	// ラベル「敵軍ダメージ」の描画
	jc.text("", 90, 160, 'rgb(255,255,255)').font(TF_FontBt).align('center').opacity(0).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('TF_EDmg').layer('TF_L_Dmg');

	// ラベル「自軍ダメージ」の描画
	jc.text("", 200, 160, 'rgb(255,255,255)').font(TF_FontBt).align('center').opacity(0).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('TF_PDmg').layer('TF_L_Dmg');

	// 敵勝敗ラベルの描画
	jc.text("勝ち", 90, 125, 'rgb(255,0,0)').font(TF_FontBt).align('center').shadow({
		x : 3,
		y : 3,
		color : '#000000'
	}).id('TF_WinE').layer('TF_L_BTL');

	jc.text("負け", 90, 125, 'rgb(0,0,255)').font(TF_FontBt).align('center').shadow({
		x : 3,
		y : 3,
		color : '#000000'
	}).id('TF_LoseE').layer('TF_L_BTW');

	// 自勝敗ラベルの描画
	jc.text("勝ち", 200, 125, 'rgb(255,0,0)').font(TF_FontBt).align('center').shadow({
		x : 3,
		y : 3,
		color : '#000000'
	}).id('TF_WinP').layer('TF_L_BTW');

	jc.text("負け", 200, 125, 'rgb(0,0,255)').font(TF_FontBt).align('center').shadow({
		x : 3,
		y : 3,
		color : '#000000'
	}).id('TF_LoseE').layer('TF_L_BTL');

	// ラベル「引き分け」の描画
	jc.text("引き分け", 145, 125, 'rgb(255,255,255)').align('center').font(TF_FontBt).shadow({
		x : 3,
		y : 3,
		color : '#000000'
	}).id('TF_Even').layer('TF_L_BTD');

	jc.layer('TF_L_Dmg').objects().visible(false);
	jc.layer('TF_L_BTW').objects().visible(false);
	jc.layer('TF_L_BTL').objects().visible(false);
	jc.layer('TF_L_BTD').objects().visible(false);

	initKomaEnemy(idCanvas);

	// jc.layer('TF_L_KJ12').objects().visible(true);
	// jc('#TF_Txt12').string('一');
	// jc('#TF_Fld12').color(setMasuClr('12', 3));
	// setStMasuSt('12', 3);
	//
	// jc.layer('TF_L_KJ22').objects().visible(true);
	// jc('#TF_Txt22').string('二');
	// jc('#TF_Fld22').color(setMasuClr('22', 3));
	// setStMasuSt('22', 3);
	//
	// jc.layer('TF_L_KJ32').objects().visible(true);
	// jc('#TF_Txt32').string('敵');
	// jc('#TF_Fld32').color(setMasuClr('32', 3));
	// setStMasuSt('32', 3);

	// 戻るボタン
	jc.rect(85, 390, 120, 30, 'rgba(256,153,0)', 1).shadow({
		x : 5,
		y : 5,
		color : '#000000'
	}).id('TF_B_RMenu').mouseover(function() {
		jc('#TF_rtnMenu').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_rtnMenu').color('rgb(0,0,0)');
	}).click(function() {
		jc.canvas(idCanvas).clear();
		loadMdTournament(idCanvas);
	}).layer('TF_L_5');

	// 戻る
	jc.text('戻　る', 145, 415, 'rgb(0,0,0)').id('TF_rtnMenu').font(TF_FontBtn).align('center').layer('TF_L_5');

	jc.layer('TF_L_5').objects().mouseover(function() {
		jc('#TF_rtnMenu').color('#ffff00');
	}).mouseout(function() {
		jc('#TF_rtnMenu').color('rgb(0,0,0)');
	});

	jc.start(idCanvas, true);

}
function initKomaEnemy(idCanvas) {
	var i = 0;
	for (i = 0; i < 6; i++) {
		if (enmyKomaPstnArray[i] != '') {
			jc.layer('TF_L_KJ' + enmyKomaPstnArray[i]).objects().visible(true);
			jc('#TF_Txt' + enmyKomaPstnArray[i]).string(enmyKomaTxtArray[i]);
			jc('#TF_Fld' + enmyKomaPstnArray[i]).color(setMasuClr(enmyKomaPstnArray[i], 3));
			setStMasuSt(enmyKomaPstnArray[i], 3);
			enmybrpnt = enmybrpnt + parseInt(enmyKomaBpArray[i]);
		}
	}
	jc('#TF_EP').string(enmybrpnt);
	jc.start(idCanvas, true);
}
function mvPsbleChck(chck) {

	var chckPsbleArray = [];
	var mvPsbleArray = [];
	var arryNum = StMasuIdObject[chck];
	var i = 0;

	chckPsbleArray[0] = arryNum - 6;
	chckPsbleArray[1] = arryNum - 5;
	chckPsbleArray[2] = arryNum - 4;
	chckPsbleArray[3] = arryNum - 1;
	chckPsbleArray[4] = arryNum + 1;
	chckPsbleArray[5] = arryNum + 4;
	chckPsbleArray[6] = arryNum + 5;
	chckPsbleArray[7] = arryNum + 6;

	for (i = 0; i < 8; i++) {
		// 25マスの範囲外は不可
		if (chckPsbleArray[i] < 1 || chckPsbleArray[i] > 25) {
			chckPsbleArray[i] = 0;
		} else if (arryNum % 5 == 1) {
			if (chckPsbleArray[i] % 5 == 0) {
				chckPsbleArray[i] = 0;
			}
		} else if (arryNum % 5 == 0) {
			if (chckPsbleArray[i] % 5 == 1) {
				chckPsbleArray[i] = 0;
			}
		}
	}
	for (i = 0; i < 8; i++) {
		if (chckPsbleArray[i] != 0) {
			if (StMasuStArray[chckPsbleArray[i] - 1] < 4) {
				mvPsbleArray[i] = StMasuIdArray[chckPsbleArray[i] - 1];
			} else {
				mvPsbleArray[i] = '';
			}
		} else {
			mvPsbleArray[i] = '';
		}
	}
	return mvPsbleArray;
}
function getPstnToIndexPlyr(pstn) {
	var i = 0;
	for (i = 0; i < 6; i++) {
		if (selKomaPstnArray[i] == pstn) {
			return i;
		}
	}
	return -1;
}
function getPstnToIndexEnmy(pstn) {
	var i = 0;
	for (i = 0; i < 6; i++) {
		if (enmyKomaPstnArray[i] == pstn) {
			return i;
		}
	}
	return -1;
}
function mvToChck(chck) {
	if (StMasuStArray[StMasuIdObject[chck] - 1] < 4) {
		return true;
	} else {
		return false;
	}
}
function enmyChck(chck) {
	if (StMasuStArray[StMasuIdObject[chck] - 1] == 3) {
		return true;
	} else {
		return false;
	}
}

function getStMasuSt(chck) {
	return StMasuStArray[StMasuIdObject[chck] - 1];
}
function setStMasuSt(chck, st) {
	StMasuStArray[StMasuIdObject[chck] - 1] = st;
}
function setMasuClr(chck, st) {
	var strClr = '';

	switch (st) {
	case 0:
		strClr = 'rgba(130,130,130,0.6)';
		break;
	case 1:
		strClr = 'rgba(255,0,0,0.6)';
		break;
	case 2:
		strClr = 'rgba(0,0,255,0.6)';
		break;
	case 3:
		strClr = 'rgba(255,0,0,0.6)';
		break;
	case 4:
		strClr = 'rgba(0,0,255,0.6)';
		break;
	default:
		strClr = 'rgba(130,130,130,0.6)';
	}
	return strClr;
}
function setTypeClr(type) {
	var strClr = '';

	if (type == 'KI') {
		strClr = 'rgba(0,255,0,1)';
	} else if (type == 'HI') {
		strClr = 'rgba(255,0,0,1)';
	} else if (type == 'KIN') {
		strClr = 'rgba(255,255,0,1)';
	} else if (type == 'DO') {
		strClr = 'rgba(204,102,0,1)';
	} else if (type == 'SUI') {
		strClr = 'rgba(51,51,255,1)';
	} else {
		strClr = 'rgba(130,130,130,1)';
	}

	return strClr;
}
function attackStartTF(idCanvas, inEBP, inPBP, inEAP, inPAP, inETP, inPTP) {

	var EF_ATNum = 1;
	var PF_ATNum = 1;

	TF_AT_START = 'START';

	TF_battleResult = '';

	var EF_RandomPT = (Math.round(Math.random() * 20 + 0.5) * 0.01) + 1;
	var PF_RandomPT = (Math.round(Math.random() * 20 + 0.5) * 0.01) + 1;

	var EF_END = '';
	var PF_END = '';
	var AT_END = '';
	var EK_COLOR = 'rgba(255,255,100)';
	var PK_COLOR = 'rgba(255,255,100)';

	// 敵軍属性Anime
	if (inETP == 'KI') {
		EK_COLOR = 'rgba(0,255,0)';
	} else if (inETP == 'HI') {
		EK_COLOR = 'rgba(255,0,0)';
	} else if (inETP == 'KIN') {
		EK_COLOR = 'rgba(255,255,0)';
	} else if (inETP == 'DO') {
		EK_COLOR = 'rgba(204,102,0)';
	} else if (inETP == 'SUI') {
		EK_COLOR = 'rgba(51,51,255)';
	} else {
		EK_COLOR = 'rgba(255,255,100)';
	}

	// 自軍属性Anime
	if (inPTP == 'KI') {
		PK_COLOR = 'rgba(0,255,0)';
	} else if (inPTP == 'HI') {
		PK_COLOR = 'rgba(255,0,0)';
	} else if (inPTP == 'KIN') {
		PK_COLOR = 'rgba(255,255,0)';
	} else if (inPTP == 'DO') {
		PK_COLOR = 'rgba(204,102,0)';
	} else if (inPTP == 'SUI') {
		PK_COLOR = 'rgba(51,51,255)';
	} else {
		PK_COLOR = 'rgba(255,255,100)';
	}

	if (inETP == 'KI' && inPTP == 'KI') {
		EF_ATNum = 1;
		PF_ATNum = 1;
	} else if (inETP == 'HI' && inPTP == 'KI') {
		EF_ATNum = 0.25;
		PF_ATNum = -0.5;
	} else if (inETP == 'DO' && inPTP == 'KI') {
		EF_ATNum = 1;
		PF_ATNum = 1.75;
	} else if (inETP == 'KIN' && inPTP == 'KI') {
		EF_ATNum = 1.75;
		PF_ATNum = 1;
	} else if (inETP == 'SUI' && inPTP == 'KI') {
		EF_ATNum = -0.5;
		PF_ATNum = 0.25;
	} else if (inETP == 'KI' && inPTP == 'HI') {
		EF_ATNum = -0.5;
		PF_ATNum = 0.25;
	} else if (inETP == 'HI' && inPTP == 'HI') {
		EF_ATNum = 1;
		PF_ATNum = 1;
	} else if (inETP == 'DO' && inPTP == 'HI') {
		EF_ATNum = 0.25;
		PF_ATNum = -0.5;
	} else if (inETP == 'KIN' && inPTP == 'HI') {
		EF_ATNum = 1;
		PF_ATNum = 1.75;
	} else if (inETP == 'SUI' && inPTP == 'HI') {
		EF_ATNum = 1.75;
		PF_ATNum = 1;
	} else if (inETP == 'KI' && inPTP == 'DO') {
		EF_ATNum = 1.75;
		PF_ATNum = 1;
	} else if (inETP == 'HI' && inPTP == 'DO') {
		EF_ATNum = -0.5;
		PF_ATNum = 0.25;
	} else if (inETP == 'DO' && inPTP == 'DO') {
		EF_ATNum = 1;
		PF_ATNum = 1;
	} else if (inETP == 'KIN' && inPTP == 'DO') {
		EF_ATNum = 0.25;
		PF_ATNum = -0.5;
	} else if (inETP == 'SUI' && inPTP == 'DO') {
		EF_ATNum = 1;
		PF_ATNum = 1.75;
	} else if (inETP == 'KI' && inPTP == 'KIN') {
		EF_ATNum = 1;
		PF_ATNum = 1.75;
	} else if (inETP == 'HI' && inPTP == 'KIN') {
		EF_ATNum = 1.75;
		PF_ATNum = 1;
	} else if (inETP == 'DO' && inPTP == 'KIN') {
		EF_ATNum = -0.5;
		PF_ATNum = 0.25;
	} else if (inETP == 'KIN' && inPTP == 'KIN') {
		EF_ATNum = 1;
		PF_ATNum = 1;
	} else if (inETP == 'SUI' && inPTP == 'KIN') {
		EF_ATNum = 0.25;
		PF_ATNum = -0.5
	} else if (inETP == 'KI' && inPTP == 'SUI') {
		EF_ATNum = 0.25;
		PF_ATNum = -0.5;
	} else if (inETP == 'HI' && inPTP == 'SUI') {
		EF_ATNum = 1;
		PF_ATNum = 1.75;
	} else if (inETP == 'DO' && inPTP == 'SUI') {
		EF_ATNum = 1.75;
		PF_ATNum = 1;
	} else if (inETP == 'KIN' && inPTP == 'SUI') {
		EF_ATNum = -0.5;
		PF_ATNum = 0.25;
	} else if (inETP == 'SUI' && inPTP == 'SUI') {
		EF_ATNum = 1;
		PF_ATNum = 1;
	} else {
		EF_ATNum = 1;
		PF_ATNum = 1;
	}

	if (inPTP == '' + playerType) {
		PF_ATNum = PF_ATNum * 1.05;
	}

	if (inETP == '' + enemyType) {
		EF_ATNum = EF_ATNum * 1.05;
	}

	jc.start(idCanvas, true);

	jc.layer('TF_L_bttl_E').fadeOut(1000, function() {
		jc('#TF_CrclEnmy').color(EK_COLOR);
		jc('#TF_TxtEnmy').color('rgba(255,255,255)');
		jc.layer('TF_L_bttl_E').fadeIn(1000, function() {
			EF_END = 'END';
		});
	});

	jc.layer('TF_L_bttl_P').fadeOut(1000, function() {
		jc('#TF_CrclPlyr').color(PK_COLOR);
		jc('#TF_TxtPlyr').color('rgba(255,255,255)');
		jc.layer('TF_L_bttl_P').fadeIn(1000, function() {
			PF_END = 'END';
		});
	});

	var cnt2 = 0;
	var cntPhase2 = 0;
	var getUserExp = 0;
	var getEneExp = 0;
	var effectFlg = 0;

	interval_5 = setInterval(function() {
		if (effectFlg == 0) {
			if (EF_END == 'END' && PF_END == 'END') {
				effectFlg = 1;
				jc.layer('TF_L_bttl_EFCT').objects().visible(true);
				jc('#label03').level('top');
				jc('#label03').visible(true);

				jc('#TF_BEfect01').translate(-10, 10, 100, function() {
					this.translate(20, -20, 200, function() {
						this.translate(-20, 20, 200, function() {
							this.translate(10, -10, 200, function() {
								this.visible(false);
							});
						});
					});
				});

				jc('#TF_BEfect02').translate(10, -10, 100, function() {
					this.translate(-20, 20, 200, function() {
						this.translate(20, -20, 200, function() {
							this.translate(-10, 10, 200, function() {
								this.visible(false);
							});
						});
					});
				});

				jc('#TF_BEfect03').translate(-10, -10, 100, function() {
					this.translate(20, 20, 200, function() {
						this.translate(-20, -20, 200, function() {
							this.translate(10, 10, 200, function() {
								this.visible(false);
							});
						});
					});
				});

				jc('#TF_BEfect04').translate(10, 10, 100, function() {
					this.translate(-20, -20, 200, function() {
						this.translate(20, 20, 200, function() {
							this.translate(-10, -10, 200, function() {
								this.visible(false);
							});
						});
					});
				});

				jc('#TF_BEfect05').translate(1, 1, 100, function() {
					this.level(this.level() - 1);
					this.translate(-2, -2, 200, function() {
						this.level(this.level() + 1);
						this.translate(2, 2, 200, function() {
							this.level(this.level() - 1);
							this.translate(-1, -1, 200, function() {
								this.level(this.level() + 1);
								this.visible(false);
								AT_END = 'END';
							});
						});
					});
				});

			}
		}
	}, 100);

	interval_2 = setInterval(function() {

		if (AT_END == 'END') {

			var wkEBP = parseInt(inEBP);
			EDmg = Math.round(inPAP * PF_ATNum * PF_RandomPT);
			if (wkEBP - EDmg > 0) {
				wkEBP = wkEBP - EDmg;
			} else {
				wkEBP = 0;
			}
			EDmg = EDmg * -1;

			var wkPBP = parseInt(inPBP);
			PDmg = Math.round(inEAP * EF_ATNum * EF_RandomPT);
			if (wkPBP - PDmg > 0) {
				wkPBP = wkPBP - PDmg;
			} else {
				wkPBP = 0;
			}
			PDmg = PDmg * -1;

			if (wkPBP == 0 && wkEBP == 0) {
				battleResult = 'P-EVEN';
			} else if (wkEBP == 0) {
				battleResult = 'P-WIN';
			} else if (wkPBP == 0) {
				battleResult = 'P-LOSE';
			} else if (wkPBP == wkEBP) {
			} else if (wkPBP > wkEBP) {
			} else if (wkPBP < wkEBP) {
			}

			// if(battleResult != ''){
			// var FD_1d = new Date();
			// $.getJSON('../main/mdFieldResult' + '?_=' +
			// FD_1d.getMilliseconds(), {
			// userId : userId,
			// eneId : eneId,
			// getUserExp : getUserExp,
			// getEneExp : getEneExp,
			// battleResult : battleResult
			// }, "json");
			// }
			clearInterval(interval_2);
			attackEndTF(idCanvas, inEBP, inPBP);
		}
	}, 500);
}
function attackEndTF(idCanvas, inEBP, inPBP) {

	jc.start(idCanvas, true);
	var wkEBP = 0;
	var wkPBP = 0;

	var EDmgTxt = '0';
	if (EDmg > 0) {
		EDmgTxt = '+' + EDmg;
		jc('#TF_EDmg').color('rgb(0,0,255)');
	} else {
		EDmgTxt = EDmg;
		jc('#TF_EDmg').color('rgb(255,255,255)');
	}

	jc('#TF_EDmg').string(EDmgTxt);

	var PDmgTxt = '0';
	if (PDmg > 0) {
		PDmgTxt = '+' + PDmg;
		jc('#TF_PDmg').color('rgb(0,0,255)');
	} else {
		PDmgTxt = PDmg;
		jc('#TF_PDmg').color('rgb(255,255,255)');
	}

	jc('#TF_PDmg').string(PDmgTxt);

	jc.layer('TF_L_Dmg').objects().visible(true);
	jc.layer('TF_L_Dmg').objects().opacity(1);
	jc.layer('TF_L_Dmg').objects().translate(0, 10, 1000, {
		type : 'inOut',
		fn : 'elastic',
		n : 1.5
	}, function() {
		this.fadeOut(1000, function() {
			jc.layer('TF_L_Dmg').objects().translate(0, -5);
		});
	});

	// 戦闘結果ラベル表示
	if (battleResult != '') {
		if (battleResult == 'P-EVEN') {
			jc.layer('TF_L_BTD').objects().visible(true);
		} else if (battleResult == 'P-WIN') {
			jc.layer('TF_L_BTW').objects().visible(true);
		} else if (battleResult == 'P-LOSE') {
			jc.layer('TF_L_BTL').objects().visible(true);
		}
	} else {
		enableSw = true;
	}

	if (inEBP + EDmg > 0) {
		enmybrpnt = enmybrpnt + EDmg;
		wkEBP = inEBP + EDmg;
	} else {
		enmybrpnt = enmybrpnt - inEBP;
		wkEBP = 0;
	}
	if (inPBP + PDmg > 0) {
		plyrbrpnt = plyrbrpnt + PDmg;
		wkPBP = inPBP + PDmg;
	} else {
		plyrbrpnt = plyrbrpnt - inPBP;
		wkPBP = 0;
	}

	jc('#TF_BpEnmy').string(wkEBP);
	jc('#TF_BpPlyr').string(wkPBP);

	jc('#TF_EP').string(enmybrpnt);
	jc('#TF_PP').string(plyrbrpnt);

	jc('#TF_CrclEnmy').color('rgba(255,255,100)');
	jc('#TF_CrclPlyr').color('rgba(255,255,100)');
	jc('#TF_TxtEnmy').color('rgba(0,0,0)');
	jc('#TF_TxtPlyr').color('rgba(0,0,0)');

	jc.start(idCanvas, true);
	setTimeout('hiddenBT(' + idCanvas + ')', 3000);
}
function hiddenBT(idCanvas) {
	jc.layer('TF_L_BTD').objects().visible(false);
	jc.layer('TF_L_BTW').objects().visible(false);
	jc.layer('TF_L_BTL').objects().visible(false);
	jc.layer('TF_L_bttl').objects().visible(false);
	jc.layer('TF_L_bttl_E').objects().visible(false);
	jc.layer('TF_L_bttl_P').objects().visible(false);
	jc.layer('TF_L_Dmg').objects().visible(false);
}
